<?php
/**
 * @description
 *  文章详细页面
 *
 * filename : /admin/modules/content/views/content_data_view.php
 * date     : 2009-2-2 18:01
 * author   : hotgun
 * email    : hotgun@163.com
 * 
 * (c)copyright hotgun
 *
 * $Id: /admin/modules/content/views/content_data_view.php,v 1.0 2009-2-2 18:01 $
 */

// 取得返回字符串
$back_url   = strcode(getcookie('back_url'), 'DECODE');
if($back_url == '') $back_url   = $mod_url['li'];


// 处理字符串防止特殊符号引起的错误，
$process_include    = array('article_title', 'sub_title', 'keywords', 'url', 'brief', 'come_from', 'author', 'outer_url', 'hits',
    'seo_title', 'seo_keywords', 'seo_description'
    );
string_pre_process($viewvar, $process_include);

// 如果分类cid未指定，默认分类id为栏目id
if($viewvar['cid'] <= 0) $viewvar['cid'] = $cata;
if($viewvar['cata_order'] >= $G_big_integer || $viewvar['cata_order'] <= 0) $viewvar['cata_order'] = '';
// 创建时间
$viewvar['createtime'] = date(DATE_TIME_FORMAT, $viewvar['createtime']);
// 发布时间
$arr_time   = getdate($viewvar['pub_time']);
$viewvar['pub_date']    = date(DATE_FORMAT, $viewvar['pub_time']);
$viewvar['pub_hour']    = @(int)$arr_time['hours'];
$viewvar['pub_min']     = @(int)$arr_time['minutes'];
$viewvar['pub_sec']     = @(int)$arr_time['seconds'];

// 审核时间
$viewvar['chk_time']    = date(DATE_TIME_FORMAT, $viewvar['chk_time']);

$txt_form_title = '修改' . $cata_keylang;


require($abs_admin_cppath . '/header.php');
?>
<link rel="stylesheet" rev="stylesheet" href="<?php echo $url_global['common']; ?>/css/win.css" type="text/css" media="all">
<link rel="stylesheet" rev="stylesheet" href="<?php echo $url_global['common']; ?>/css/win.css" type="text/css" media="all">
<link rel="stylesheet" rev="stylesheet" href="<?php echo $url_global['common']; ?>/css/win.css" type="text/css" media="all">
<link rel="stylesheet" href="<?php echo $url_global['common']; ?>/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="<?php echo $url_global['common']; ?>/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="<?php echo $url_global['common']; ?>/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="<?php echo $url_global['common']; ?>/kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="<?php echo $url_global['common']; ?>/kindeditor/plugins/code/prettify.js"></script>
<script>
	KindEditor.ready(function(K) {
		var editor1 = K.create('textarea[id="content"]', {
			cssPath : '<?php echo $url_global['common']; ?>/kindeditor/plugins/code/prettify.css',
			uploadJson : '<?php echo $url_global['common']; ?>/kindeditor/php/upload_json.php',
			fileManagerJson : '<?php echo $url_global['common']; ?>/kindeditor/php/file_manager_json.php',
			allowFileManager : true,
			afterCreate : function() {
				var self = this;
				K.ctrl(document, 13, function() {
					self.sync();
					K('form[name=example]')[0].submit();
				});
				K.ctrl(self.edit.doc, 13, function() {
					self.sync();
					K('form[name=example]')[0].submit();
				});
			}
		});
		prettyPrint();
	});
</script>

<SCRIPT LANGUAGE="JavaScript" SRC="<?php echo $url_global['common']; ?>/js/win.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="<?php echo $url_global['common']; ?>/js/Validator.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="<?php echo $url_global['common']; ?>/js/popcalendar.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="<?php echo $url_global['common']; ?>/js/jquery-1.3.2.min.js"></SCRIPT>

		<div class="datacontainer2" style="width:90%;">
<div class="header">
<?php echo $txt_form_title ?>
</div>
<form action="<?php echo $mod_url['save'] ?>" method="post" name="article_data" enctype="multipart/form-data" onsubmit="return Validator.Validate(this,3);">
<table BORDER="0" cellpadding="0" cellspacing="0" width="100%" class="list_table">

<TR>
	<TD width="80" align="right" class="caption"><?php echo $cata_keylang; ?>标题</TD>
	<TD class="cell" colspan="3">
		<input type="text" name="article[article_title]" id="article_title" value="<?php echo $viewvar['article_title']; ?>" class="text" style="width:440px;color:<?php echo $viewvar['tcolor'];?>"

		dataType="Require" dataType="Limit" min="1" max="255" msg="<?php echo $cata_keylang; ?>标题必须填写且必须符合上述规则">
	
	</TD>
</TR>
<TR>
	<TD colspan="4" class="cell graycell">
<?php
//编辑器
/*require($G_abs_common . '/fckeditor/fckeditor.php');
$oFCKeditor             = new FCKeditor('article[content]') ;
$oFCKeditor->BasePath   = $G_web_common . '/fckeditor/';
$oFCKeditor->UpPath     = '/upload/site/';
$oFCKeditor->Value      = $viewvar['content'];
$oFCKeditor->Width      = '100%';
$oFCKeditor->Height     = 400;
$FCKeditHtml            = $oFCKeditor->CreateHtml() ;
echo $FCKeditHtml;*/
?>
<textarea name="article[content]" id="content" style="width:700px;height:400px;visibility:hidden;"><?php echo htmlspecialchars($viewvar['content']); ?></textarea>
	</TD>
</TR>

<TR>
	<TD class="submit" colspan="4" align="center">
		<input type="submit" value=" 保存 " class="btn">
		<input type="reset" value=" 重置 " class="btn">
		<input type="button" value=" 返回 " class="btn" onclick="location.href='<?php echo $back_url; ?>'">
		<input type="hidden" name="article[showid]" id="showid" value="<?php echo $viewvar['showid'];?>">
		<input type="hidden" name="article[aid]" value="<?php echo $viewvar['aid']; ?>">
		<input type="hidden" name="article[gsid]" value="<?php echo $viewvar['gsid']; ?>">
		<input type="hidden" name="article[uid]" value="<?php echo $viewvar['uid']; ?>">
		<input type="hidden" name="article[cata]" value="<?php echo $cata; ?>">
		<input type="hidden" name="save" value="<?php echo $save_flag; ?>">
	</TD>
</TR>

</TABLE>
</form>
		</div>
<?php
echo_html_img_js()
?>
<SCRIPT LANGUAGE="JavaScript">
<!--
function outer_file_url_onclick(o) {
    var div = GE('html_file_url');
    if(o.checked) {
        div.style.display = 'block';
    } else {
        div.style.display = 'none';
    }
}
//-->
</SCRIPT>
<?php
require($abs_admin_cppath . '/footer.php');
?>